
N = 100000
trials = []

niner = Double.parseDouble(args[0])

for (t = 0; t < N; t++)
{
  target = 100.0
  i = 0
  while (target < 200.0)
  {
    if (Math.random() < 0.5) 
      rate = niner
    else
      rate = 1.10
    target *= rate
    i++
  }
  trials.add(i)
  // println i
}

avg = ((double)(trials.sum())) / N;
println avg
